Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An initial implementation of the phase noise channel #513

Merged
merged 34 commits into from
Nov 5, 2024

Conversation

arsalan-motamedi
Copy link
Collaborator

@arsalan-motamedi arsalan-motamedi commented Oct 25, 2024

Context:
Adds the phase noise with a Fock representation.

Description of the Change:
Added a class under Channel. Please note that if we wanted to actually write a Fock array for this channel, it would be extremely heavy (I ran into memory issues). Therefore, we implement contractions with PhaseNoise in a particular way, using a custum rrshift method. I believe a similar logic was used in lab before.

Benefits:
Enables us to apply phase noise.

Possible Drawbacks:
Could be slow.

@arsalan-motamedi arsalan-motamedi added the no changelog Pull request does not require a CHANGELOG entry label Oct 25, 2024
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.84%. Comparing base (3a1d8bb) to head (c7d3c18).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #513      +/-   ##
===========================================
+ Coverage    89.77%   89.84%   +0.07%     
===========================================
  Files           92       93       +1     
  Lines         6072     6098      +26     
===========================================
+ Hits          5451     5479      +28     
+ Misses         621      619       -2     
Files with missing lines Coverage Δ
mrmustard/lab_dev/states/base.py 96.64% <ø> (ø)
mrmustard/lab_dev/states/dm.py 95.65% <ø> (ø)
mrmustard/lab_dev/states/ket.py 98.59% <ø> (ø)
mrmustard/lab_dev/transformations/__init__.py 100.00% <100.00%> (ø)
mrmustard/lab_dev/transformations/amplifier.py 100.00% <100.00%> (ø)
mrmustard/lab_dev/transformations/attenuator.py 100.00% <100.00%> (ø)
...rmustard/lab_dev/transformations/gaussrandnoise.py 100.00% <100.00%> (ø)
mrmustard/lab_dev/transformations/phasenoise.py 100.00% <100.00%> (ø)
mrmustard/physics/triples.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a1d8bb...c7d3c18. Read the comment docs.

Copy link
Collaborator

@apchytr apchytr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great thanks!

mrmustard/lab_dev/states/base.py Show resolved Hide resolved
mrmustard/lab_dev/transformations/phasenoise.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/phasenoise.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/phasenoise.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/phasenoise.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/phasenoise.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/phasenoise.py Outdated Show resolved Hide resolved
mrmustard/physics/fock_utils.py Outdated Show resolved Hide resolved
tests/test_lab_dev/test_transformations/test_phasenoise.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@ziofil ziofil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work Arsalan! But see my comment about that potential issue

mrmustard/lab_dev/transformations/phasenoise.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@apchytr apchytr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Arsalan!

mrmustard/lab_dev/states/base.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/states/dm.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/states/ket.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/states/ket.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/phasenoise.py Outdated Show resolved Hide resolved
mrmustard/lab_dev/transformations/phasenoise.py Outdated Show resolved Hide resolved
tests/test_lab_dev/test_transformations/test_phasenoise.py Outdated Show resolved Hide resolved
mrmustard/lab/gates.py Show resolved Hide resolved
Copy link
Collaborator

@ziofil ziofil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@arsalan-motamedi arsalan-motamedi merged commit 0058d6b into develop Nov 5, 2024
8 checks passed
@arsalan-motamedi arsalan-motamedi deleted the phase-noise branch November 5, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Pull request does not require a CHANGELOG entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants